\doxysection{C\+:/\+Users/\+ASUS/\+Desktop/dm-\/ctrl\+H7-\/balance-\/9025test/modules/remote/remote\+\_\+control.h File Reference}
\hypertarget{remote__control_8h}{}\label{remote__control_8h}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/remote/remote\_control.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/remote/remote\_control.h}}


遥控器模块定义头文件  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include "{}main.\+h"{}}\newline
{\ttfamily \#include "{}usart.\+h"{}}\newline
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
union \mbox{\hyperlink{union_key__t}{Key\+\_\+t}}
\item 
struct \mbox{\hyperlink{struct_r_c__ctrl__t}{RC\+\_\+ctrl\+\_\+t}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{remote__control_8h_a210af1d04c8870416a556f0e9a5194fd}\label{remote__control_8h_a210af1d04c8870416a556f0e9a5194fd} 
\#define {\bfseries LAST}~1
\item 
\Hypertarget{remote__control_8h_a10bed19ceedeb2c12c5aad6de1d3b1a1}\label{remote__control_8h_a10bed19ceedeb2c12c5aad6de1d3b1a1} 
\#define {\bfseries TEMP}~0
\item 
\Hypertarget{remote__control_8h_a1f701b69c55bf40943c5a4d5ff53192f}\label{remote__control_8h_a1f701b69c55bf40943c5a4d5ff53192f} 
\#define {\bfseries KEY\+\_\+\+PRESS}~0
\item 
\Hypertarget{remote__control_8h_a4c2009f45b1129fcbb7e84614f9c852c}\label{remote__control_8h_a4c2009f45b1129fcbb7e84614f9c852c} 
\#define {\bfseries KEY\+\_\+\+STATE}~1
\item 
\Hypertarget{remote__control_8h_a43b68c4a6becdfbdf7e58ca591dc571a}\label{remote__control_8h_a43b68c4a6becdfbdf7e58ca591dc571a} 
\#define {\bfseries KEY\+\_\+\+PRESS\+\_\+\+WITH\+\_\+\+CTRL}~1
\item 
\Hypertarget{remote__control_8h_a61514e4fc794bdaad7be1bff200899a7}\label{remote__control_8h_a61514e4fc794bdaad7be1bff200899a7} 
\#define {\bfseries KEY\+\_\+\+PRESS\+\_\+\+WITH\+\_\+\+SHIFT}~2
\item 
\Hypertarget{remote__control_8h_a6d8cc96f7dc81b63dff7985195cf4472}\label{remote__control_8h_a6d8cc96f7dc81b63dff7985195cf4472} 
\#define {\bfseries RC\+\_\+\+CH\+\_\+\+VALUE\+\_\+\+MIN}~((uint16\+\_\+t)364)
\item 
\Hypertarget{remote__control_8h_a0af03ce64676e443225138a51596fae5}\label{remote__control_8h_a0af03ce64676e443225138a51596fae5} 
\#define {\bfseries RC\+\_\+\+CH\+\_\+\+VALUE\+\_\+\+OFFSET}~((uint16\+\_\+t)1024)
\item 
\Hypertarget{remote__control_8h_a1702cd2d4d8393bdc7e340b0e42e585f}\label{remote__control_8h_a1702cd2d4d8393bdc7e340b0e42e585f} 
\#define {\bfseries RC\+\_\+\+CH\+\_\+\+VALUE\+\_\+\+MAX}~((uint16\+\_\+t)1684)
\item 
\Hypertarget{remote__control_8h_a46307affe6d9beb62ff99bdc40e51e87}\label{remote__control_8h_a46307affe6d9beb62ff99bdc40e51e87} 
\#define {\bfseries RC\+\_\+\+SW\+\_\+\+UP}~((uint16\+\_\+t)1)
\item 
\Hypertarget{remote__control_8h_a0ff9de2513487653ae3352abb3ffd197}\label{remote__control_8h_a0ff9de2513487653ae3352abb3ffd197} 
\#define {\bfseries RC\+\_\+\+SW\+\_\+\+MID}~((uint16\+\_\+t)3)
\item 
\Hypertarget{remote__control_8h_a588383ae82bd06145cfe01a7414c03fd}\label{remote__control_8h_a588383ae82bd06145cfe01a7414c03fd} 
\#define {\bfseries RC\+\_\+\+SW\+\_\+\+DOWN}~((uint16\+\_\+t)2)
\item 
\#define \mbox{\hyperlink{remote__control_8h_a0c177888ad36ad913ccc7ae75bf00d6a}{switch\+\_\+is\+\_\+down}}(s)
\item 
\#define \mbox{\hyperlink{remote__control_8h_aa46da519169b1d7b4bd35d61811cd7e4}{switch\+\_\+is\+\_\+mid}}(s)
\item 
\#define \mbox{\hyperlink{remote__control_8h_abae573966e94400154a74415acb93b57}{switch\+\_\+is\+\_\+up}}(s)
\item 
\Hypertarget{remote__control_8h_a40dfc9cfb345cecb45a049eb1f852374}\label{remote__control_8h_a40dfc9cfb345cecb45a049eb1f852374} 
\#define {\bfseries Key\+\_\+W}~0
\item 
\Hypertarget{remote__control_8h_a23ff76e78cba346acb0d295b25f1bb66}\label{remote__control_8h_a23ff76e78cba346acb0d295b25f1bb66} 
\#define {\bfseries Key\+\_\+S}~1
\item 
\Hypertarget{remote__control_8h_a71ce85b9e0e02c176f138ac8862e7cd4}\label{remote__control_8h_a71ce85b9e0e02c176f138ac8862e7cd4} 
\#define {\bfseries Key\+\_\+D}~2
\item 
\Hypertarget{remote__control_8h_a24d9affbcdf64e83be05a38c5998bc69}\label{remote__control_8h_a24d9affbcdf64e83be05a38c5998bc69} 
\#define {\bfseries Key\+\_\+A}~3
\item 
\Hypertarget{remote__control_8h_ac5fc36ebc44e84c868fa2be0c1a0a93c}\label{remote__control_8h_ac5fc36ebc44e84c868fa2be0c1a0a93c} 
\#define {\bfseries Key\+\_\+\+Shift}~4
\item 
\Hypertarget{remote__control_8h_a1d5e89147efd49e5b64a828e965753d4}\label{remote__control_8h_a1d5e89147efd49e5b64a828e965753d4} 
\#define {\bfseries Key\+\_\+\+Ctrl}~5
\item 
\Hypertarget{remote__control_8h_a45594a015694106d485fba97f904bcc9}\label{remote__control_8h_a45594a015694106d485fba97f904bcc9} 
\#define {\bfseries Key\+\_\+Q}~6
\item 
\Hypertarget{remote__control_8h_a3de9e8d945526de4c712999aa81984dd}\label{remote__control_8h_a3de9e8d945526de4c712999aa81984dd} 
\#define {\bfseries Key\+\_\+E}~7
\item 
\Hypertarget{remote__control_8h_a634f7ddef613cb22c5b84799943ad92f}\label{remote__control_8h_a634f7ddef613cb22c5b84799943ad92f} 
\#define {\bfseries Key\+\_\+R}~8
\item 
\Hypertarget{remote__control_8h_a24bc6030141be487ffb76330d467ee2d}\label{remote__control_8h_a24bc6030141be487ffb76330d467ee2d} 
\#define {\bfseries Key\+\_\+F}~9
\item 
\Hypertarget{remote__control_8h_aa943cd8ab77d38fa3323b7328d678950}\label{remote__control_8h_aa943cd8ab77d38fa3323b7328d678950} 
\#define {\bfseries Key\+\_\+G}~10
\item 
\Hypertarget{remote__control_8h_a67ddf4f577ecb17bbeeb8273aeda9907}\label{remote__control_8h_a67ddf4f577ecb17bbeeb8273aeda9907} 
\#define {\bfseries Key\+\_\+Z}~11
\item 
\Hypertarget{remote__control_8h_a08d52f3677caa0ddf810b77910d94fd0}\label{remote__control_8h_a08d52f3677caa0ddf810b77910d94fd0} 
\#define {\bfseries Key\+\_\+X}~12
\item 
\Hypertarget{remote__control_8h_acc45f6ddd18ef0ec94f767fab27a2778}\label{remote__control_8h_acc45f6ddd18ef0ec94f767fab27a2778} 
\#define {\bfseries Key\+\_\+C}~13
\item 
\Hypertarget{remote__control_8h_a5436f7a28b9d744e6e1cd52b2c9aa87e}\label{remote__control_8h_a5436f7a28b9d744e6e1cd52b2c9aa87e} 
\#define {\bfseries Key\+\_\+V}~14
\item 
\Hypertarget{remote__control_8h_aeeddc93e06878d5a0204190833153a8b}\label{remote__control_8h_aeeddc93e06878d5a0204190833153a8b} 
\#define {\bfseries Key\+\_\+B}~15
\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{struct_r_c__ctrl__t}{RC\+\_\+ctrl\+\_\+t}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{remote__control_8h_a1ae5e1b9954a0aa410f5e480f3a000b9}{Remote\+Control\+Init}} (\mbox{\hyperlink{group___u_a_r_t___exported___types_ga5de4a49eb132735325e706f406c69d6e}{UART\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}rc\+\_\+usart\+\_\+handle)
\begin{DoxyCompactList}\small\item\em 初始化遥控器,该函数会将遥控器注册到串口 \end{DoxyCompactList}\item 
uint8\+\_\+t \mbox{\hyperlink{remote__control_8h_acfec81351f882dc5d2a47ad94684d834}{Remote\+Control\+Is\+Online}} ()
\begin{DoxyCompactList}\small\item\em 检查遥控器是否在线,若尚未初始化也视为离线 \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
遥控器模块定义头文件 

\begin{DoxyAuthor}{Author}
DJI 2016 

modified by neozng 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
beta 
\end{DoxyVersion}
\begin{DoxyDate}{Date}
2022-\/11-\/01
\end{DoxyDate}
\begin{DoxyCopyright}{Copyright}
Copyright (c) 2016 DJI corp 

Copyright (c) 2022 HNU Yue\+Lu EC all rights reserved 
\end{DoxyCopyright}


\label{doc-define-members}
\Hypertarget{remote__control_8h_doc-define-members}
\doxysubsection{Macro Definition Documentation}
\Hypertarget{remote__control_8h_a0c177888ad36ad913ccc7ae75bf00d6a}\index{remote\_control.h@{remote\_control.h}!switch\_is\_down@{switch\_is\_down}}
\index{switch\_is\_down@{switch\_is\_down}!remote\_control.h@{remote\_control.h}}
\doxysubsubsection{\texorpdfstring{switch\_is\_down}{switch\_is\_down}}
{\footnotesize\ttfamily \label{remote__control_8h_a0c177888ad36ad913ccc7ae75bf00d6a} 
\#define switch\+\_\+is\+\_\+down(\begin{DoxyParamCaption}\item[{}]{s}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{(s\ ==\ RC\_SW\_DOWN)}

\end{DoxyCode}
\Hypertarget{remote__control_8h_aa46da519169b1d7b4bd35d61811cd7e4}\index{remote\_control.h@{remote\_control.h}!switch\_is\_mid@{switch\_is\_mid}}
\index{switch\_is\_mid@{switch\_is\_mid}!remote\_control.h@{remote\_control.h}}
\doxysubsubsection{\texorpdfstring{switch\_is\_mid}{switch\_is\_mid}}
{\footnotesize\ttfamily \label{remote__control_8h_aa46da519169b1d7b4bd35d61811cd7e4} 
\#define switch\+\_\+is\+\_\+mid(\begin{DoxyParamCaption}\item[{}]{s}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{(s\ ==\ RC\_SW\_MID)}

\end{DoxyCode}
\Hypertarget{remote__control_8h_abae573966e94400154a74415acb93b57}\index{remote\_control.h@{remote\_control.h}!switch\_is\_up@{switch\_is\_up}}
\index{switch\_is\_up@{switch\_is\_up}!remote\_control.h@{remote\_control.h}}
\doxysubsubsection{\texorpdfstring{switch\_is\_up}{switch\_is\_up}}
{\footnotesize\ttfamily \label{remote__control_8h_abae573966e94400154a74415acb93b57} 
\#define switch\+\_\+is\+\_\+up(\begin{DoxyParamCaption}\item[{}]{s}{}\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{(s\ ==\ RC\_SW\_UP)}

\end{DoxyCode}


\label{doc-func-members}
\Hypertarget{remote__control_8h_doc-func-members}
\doxysubsection{Function Documentation}
\Hypertarget{remote__control_8h_a1ae5e1b9954a0aa410f5e480f3a000b9}\index{remote\_control.h@{remote\_control.h}!RemoteControlInit@{RemoteControlInit}}
\index{RemoteControlInit@{RemoteControlInit}!remote\_control.h@{remote\_control.h}}
\doxysubsubsection{\texorpdfstring{RemoteControlInit()}{RemoteControlInit()}}
{\footnotesize\ttfamily \label{remote__control_8h_a1ae5e1b9954a0aa410f5e480f3a000b9} 
\mbox{\hyperlink{struct_r_c__ctrl__t}{RC\+\_\+ctrl\+\_\+t}} \texorpdfstring{$\ast$}{*} Remote\+Control\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group___u_a_r_t___exported___types_ga5de4a49eb132735325e706f406c69d6e}{UART\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{rc\+\_\+usart\+\_\+handle}{}\end{DoxyParamCaption})}



初始化遥控器,该函数会将遥控器注册到串口 

\begin{DoxyAttention}{Attention}
注意分配正确的串口硬件,遥控器在\+C板上使用\+USART3 
\end{DoxyAttention}
\Hypertarget{remote__control_8h_acfec81351f882dc5d2a47ad94684d834}\index{remote\_control.h@{remote\_control.h}!RemoteControlIsOnline@{RemoteControlIsOnline}}
\index{RemoteControlIsOnline@{RemoteControlIsOnline}!remote\_control.h@{remote\_control.h}}
\doxysubsubsection{\texorpdfstring{RemoteControlIsOnline()}{RemoteControlIsOnline()}}
{\footnotesize\ttfamily \label{remote__control_8h_acfec81351f882dc5d2a47ad94684d834} 
uint8\+\_\+t Remote\+Control\+Is\+Online (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



检查遥控器是否在线,若尚未初始化也视为离线 

\begin{DoxyReturn}{Returns}
uint8\+\_\+t 1\+:在线 0\+:离线 
\end{DoxyReturn}
